//浏览器打开时执行的函数
window.onload=function(){
	Weather_Time();
	sec_resize();
}
//根据当前日期变换时间图片
var NowDate = new Date();
var WeekDay = new Array("sunday","monday","tuesday","wendesday","thursday","friday","saturday");
var Month   = new Array("month1","month2","month3","month4","month5","month6","month7","month8","month9","month10","month11","month12");
var DateTime= new Array("0","1","2","3","4","5","6","7","8","9");
var Cur_Time= new Array("earlymoning","morning","lunchtime","afternoon","evening","nighttime")
function Weather_Time(){
	//星期
	document.getElementById("Week").src="img/WeekDay/"+WeekDay[NowDate.getDay()]+".png";
	//月份
	document.getElementById("Month").src="img/Month/"+Month[NowDate.getMonth()]+".png";
	//日期
	document.getElementById("Date1").src="img/Date/"+DateTime[parseInt(NowDate.getDate()/10)]+".png";
	document.getElementById("Date2").src="img/Date/"+DateTime[NowDate.getDate()%10]+".png";
	//时间
	var time = NowDate.getHours();
	if(time>=3&&time<=6){
		document.getElementById("Time").src="img/Time/"+Cur_Time[0]+".png";
	}else if(time<=11){
		document.getElementById("Time").src="img/Time/"+Cur_Time[1]+".png";
	}else if(time<=14){
		document.getElementById("Time").src="img/Time/"+Cur_Time[2]+".png";
	}else if(time<=18){
		document.getElementById("Time").src="img/Time/"+Cur_Time[3]+".png";
	}else if(time<=22){
		document.getElementById("Time").src="img/Time/"+Cur_Time[4]+".png";
	}else{
		document.getElementById("Time").src="img/Time/"+Cur_Time[5]+".png";
	}
}
//自适应
$(document).ready(function(){
	$(window).resize(function() {
		sec_resize();
	});
});
function sec_resize(){
	x1=$(".wrapper").width();
	$(".wrapper .left").show();
	if (x1>800){
		$("nav").show();
		$(".navbar2").show();
		$(".navbar3").hide();
		$("#Time").show();
		$(".weather img").css({'height':x1*0.07});
		$(".weather > img:nth-child(2),.weather > img:nth-child(3)").height(x1*0.035);
		y2=$(".header").width();
		y3=$(".navbar").width();
		$(".header").height(y2*0.07);
		$("ul .navbar").css({'font-size':y2*0.015,'height':y3*0.2});
		h2=$(".navbar2").height();
		$(".wrapper .left").css({'width':x1*0.3,'height':x1*0.9});
		$(".wrapper .login-01").css({'width':x1*0.6,'height':x1*0.9});
		$(".first .text,.second .Message,.button").css({'font-size':x1*0.014});
		$(".first img,.second img").css({'height':x1*0.07});
		$(".wrapper").height(x1*0.9+h2);
	}else{
		$("nav").hide();
		$(".navbar2").hide();
		$(".navbar3").show();
		$("#Time").hide();
		//头尾
		y2=$(".header").width();
		$(".header").height(y2*0.12);
		$(".footer").css({'font-size':y2*0.015});
		$(".weather img").css({'height':y2*0.1});
		$(".weather > img:nth-child(2),.weather > img:nth-child(3)").height(y2*0.05);
		if(x1>500){
			$(".wrapper .left").css({'width':x1*0.3,'height':x1*0.9});
			$(".wrapper .login-01").css({'width':x1*0.6,'height':x1*0.9});
			$(".first .text,.second .Message,.button").css({'font-size':x1*0.014});
			$(".first img,.second img").css({'height':x1*0.07});
			$(".wrapper").height(x1*0.9);
		}else{
			$(".wrapper .left").hide();
			$(".wrapper .login-01").css({'width':x1*0.9,'height':x1*1.2});
			$(".first .text,.second .Message,.button").css({'font-size':x1*0.00005});
			$(".first img,.second img").css({'height':x1*0.07});
			$(".wrapper").height(x1*1.2);
		}
	}
}